<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="br.com.senac.pi5.comum.ComumBO"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <title>ADA Airlines</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

        <!-- Importação dos CSS's -->
        <link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
        <link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
        <link rel="stylesheet" href="css/style.css" type="text/css" media="all">

    </head>
    <body>
        <script type="text/javascript" src="js/validacao.js"></script>
        <form action="dependente" method="post" onsubmit="return validaCampos(this);">
            <div class="main">

                <!--header -->
                <header>
                    <div class="wrapper">
                        <h1><a href="index.html" id="logo">Air lines</a></h1>
                        <span id="slogan">Voos Rápidos, Frequentes e Seguros</span>
                    </div>
                    <nav>
                        <ul id="menu">
                            <li><a href="index.html"><span><span>Home</span></span></a></li>
                            <li><a href="passagens.jsp"><span><span>Passagens</span></span></a></li>
                            <li id="menu_active"><a href="incluiCadastro.jsp"><span><span>Cadastre-se</span></span></a></li>
                            <li class="end"><a href="login.jsp"><span><span>Log in</span></span></a></li>
                        </ul>
                    </nav>
                </header>
                <!-- / header -->

                <!--content -->
                <form method="post" action="dependente">
                    <%

                    %>
                    <script type="text/javascript" src="js/passagens.js"></script>
                    <h3> Dados dos passageiros </h3>
                    <c:forEach var="dependente" items="${detalhesPassagem.listaDependentes}" varStatus="status">
                        <table border = 0>
                            <h2> Passageiro #${status.count}  </h2>
                            <tr>
                                <td><label for ="nome">Nome:</label></td>
                                <td><input type="text" name="nome" id="nome" maxlength="20"/></td>
                            </tr>
                            <tr>
                                <td><label for ="sobrenome">Sobrenome:</label></td>
                                <td><input type="text" name="sobrenome" id="sobrenome" maxlength="50"/></td>
                            </tr>
                            <tr>  
                                <td><label for ="sexo">Sexo:</label>
                                <td><input type="text" name="sexo" id="sexo" maxlength="15"/></td>
                                </td>  
                            </tr>  
                            <tr>
                                <td><label for ="rg">RG:</label></td>
                                <td><input type="text" name="rg" id="rg" maxlength="15"/></td>
                            </tr>
                            <tr>
                                <td><label for ="cpf">CPF:</label></td>
                                <td><input type="text" name="cpf" id="cpf" maxlength="15"/></td>
                            </tr>
                            <tr>
                                <td><label for ="dt_nasc">Data de Nascimento:</label></td>
                                <td><input type="text" name="dt_nasc" id="dt_nasc" maxlength="10"/></td>
                            </tr>
                            <tr>
                                <td><span class="left">Poltrona:</span></td>
                                <td>
                                    <select name="poltronas">  
                                        <option value="0">--</option>

                                        <%                                            ComumBO bo = new ComumBO();
                                            List<String> poltronas = new ArrayList<String>();
                                            poltronas = bo.listarPoltronas();
                                            for (String poltrona : poltronas) {
                                        %>  
                                        <option value=<%=poltrona%>> <%=poltrona%> </option>      
                                        <% }
                                        %>  
                                    </select> 
                                </td>
                            </tr>     
                        </table>
                    </c:forEach>
                    <br>
                    <br>

                    <input type="checkbox" id = "milhagens" name="milhagens"><span><b> Gostaria de participar do programa de milhagens.</b></span></input>

                    <br>
                    <br>

                    <button type="submit" id="continuar" class="button1">Continuar</button>
                </form>

                <!--footer -->
                <footer>
                    <div class="wrapper">
                        <div class="links">
                            Produzido por IT Enterprises.
                        </div>
                    </div>
                </footer>
                <!--footer end-->

            </div>
        </form>
    </body>
</html>
